package com.lahuan.config.distributed;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class CustomIdGenerator implements IdentifierGenerator {
    @Value("${custom.distributedId}")
    int serveId;


    @Override
    public Number nextId(Object entity) {
        return CustomDistributedIdGenerateUtil.generate(serveId);
    }
}
